package com.ean.backpack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ean.backpack.domain.Propertydescriptionlist;
import com.ean.backpack.repository.PropertydescriptionlistRepository;
import com.ean.backpack.service.PropertydescriptionlistService;

@Service
@Transactional
public class PropertydescriptionlistServiceImpl implements
		PropertydescriptionlistService {

	@Autowired
	PropertydescriptionlistRepository propertydescriptionlistRepository;

	public long countAllPropertydescriptionlists() {
		return propertydescriptionlistRepository.count();
	}

	public void deletePropertydescriptionlist(
			Propertydescriptionlist propertydescriptionlist) {
		propertydescriptionlistRepository.delete(propertydescriptionlist);
	}

	public Propertydescriptionlist findPropertydescriptionlist(Integer id) {
		return propertydescriptionlistRepository.findOne(id);
	}

	public List<Propertydescriptionlist> findAllPropertydescriptionlists() {
		return propertydescriptionlistRepository.findAll();
	}

	public List<Propertydescriptionlist> findPropertydescriptionlistEntries(
			int firstResult, int maxResults) {
		return propertydescriptionlistRepository.findAll(
				new org.springframework.data.domain.PageRequest(firstResult
						/ maxResults, maxResults)).getContent();
	}

	public void savePropertydescriptionlist(
			Propertydescriptionlist propertydescriptionlist) {
		propertydescriptionlistRepository.save(propertydescriptionlist);
	}

	public Propertydescriptionlist updatePropertydescriptionlist(
			Propertydescriptionlist propertydescriptionlist) {
		return propertydescriptionlistRepository.save(propertydescriptionlist);
	}
}
